/*
Form
*/

.an-form {
    --an-font-size: 14px;
    --an-padding: 10px;
    --an-label-width: 80px;
    --an-input-height: var(--an-height);
    --an-gap: 20px;

    &[inline] {
        --an-input-width: 200px;

        .an-row {
            gap: var(--an-gap) 0;
        }
    }

    &:not([inline]) {
        --an-input-width: 100%;

        .an-row {
            gap: var(--an-gap) 0;

            .an-col {
                --an-col-width: 100%;
            }
        }

        & .an-form-item {
            width: 100%;
        }
    }

    & .an-form-item {
        display: flex;
        align-items: stretch;
    }

    & .an-form-item-label {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        width: var(--an-label-width);
        padding-right: var(--an-padding);
        font-size: var(--an-font-size);

        & .an-form-item-required {
            color: var(--an-color-danger);
            display: inline-flex;
            align-items: center;
        }
    }

    & .an-form-item-content {
        display: flex;
        width: 100%;
    }

    & .an-form-item-label~.an-form-item-content {
        width: calc(100% - var(--an-label-width));
    }
}

.an-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;

    & .an-input {
        display: block;
        width: var(--an-input-width);
        height: var(--an-input-height);
        line-height: var(--an-input-height);
        padding-inline: var(--an-padding);
        font-size: var(--an-font-size);
        border: var(--an-border);
        border-radius: var(--an-border-radius);
        transition: border .3s;
        background: transparent;
        font-family: inherit;

        &::-webkit-input-placeholder {
            color: var(--an-color-text-placeholder);
        }

        &[type="password"]::-ms-reveal {
            display: none;
        }

        &:focus {
            border-color: var(--an-color-primary);
        }
    }

    & textarea.an-input {
        min-height: calc(var(--an-input-height) * 2);
        line-height: var(--an-input-height);
        font-family: inherit;
    }

    &.an-input-suffix {
        & .an-input {
            padding-inline-end: calc(var(--an-font-size) + 20px);
        }

        & .an-icon {
            position: absolute;
            top: 0;
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            cursor: pointer;
            color: var(--an-color-text-secondary);
            font-size: var(--an-font-size);
            z-index: 1;
        }
    }

    & .an-input-err-msg {
        display: none;
        position: absolute;
        top: var(--an-input-height);
        left: 0;
        margin-block-start: 3px;
        font-size: 12px;
        line-height: 14px;
        color: var(--an-color-danger);
        z-index: 1;
    }

    &.an-input-err {
        & .an-input-err-msg {
            display: block;
        }
    }
}

.an-select-wrapper {
    position: relative;
    
}